#include <bits/stdc++.h>
using namespace std;
int n, m;
int w[16];
long long f[3001];

int main() {
    cin >> n >> m;
    for (int i = 1; i <= n; i++) {
        cin >> w[i];
    }
    f[0] = 1;
    for (int i = 1; i <= n; i++) {
        for (int v = w[i]; v <= m; v++) {
            f[v] += f[v - w[i]];
        }
    }
    cout << f[m];
    return 0;
}